<%@page import="databank.DatabankVo"%>
<%@page import="databank.DataBank"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>view.jsp</title>
<script>
function modify(serial){
	location.href="index2.jsp?inc_content=./databank/modify.jsp&serial="+serial;	
}
function del(serial,filename){
	var y= confirm("정말 삭제하시겠습니까?");
	if(y){
		location.href = 'index2.jsp?inc_content=./databank/delete_result.jsp&serial=' + serial + '&filename=' +filename;
		
	}else{
		alert("삭제가 취소되었습니다.");
	}
}
function btnList(){
		location.href="index2.jsp?inc_content=./databank/list.jsp";
	}
	
//파일 다운로드 스크립트
//새창을 열어 첨부파일을 무조건 다운로드하도록 조치
function fileDown(filename){
	url="./databank/filedownload.jsp?filename="+filename;
	win = window.open(url,"win","");
	
}

</script>
</head>
<body>
<jsp:useBean id="bankVo" class="databank.DatabankVo"/>
<jsp:setProperty property="*" name="bankVo"/>


<%
DataBank bank=new DataBank();
bank.setVo(bankVo);
DatabankVo v= bank.view();
String url="./upload/"+v.getFilename();
%>
	<h1>게시글 확인</h1>
	
		<ul>
		
		<li>Serial:<%=v.getSerial() %>
		<li>작성자:<%=v.getMid() %>
		<li>작성일:<%=v.getMdate() %>
		<li>제목:<%=v.getSubject() %>
		<li>내용:<%=v.getContent() %>
		<li>첨부파일1:<a href='#' onclick="fileDown('<%=v.getFilename()%>')"><%=v.getFilename() %></a>
			
		</ul>
	
		<div>
			<input type="button" value="수정" onclick="modify(<%=v.getSerial()%>)">
			<input type="button" value="삭제" onclick="del(<%=v.getSerial()%>,'<%=v.getFilename()%>')"> 
			<input type="button" value="목록" onclick="btnList()">
		</div>
	

</body>
</html>